<template>
	<view class="noticeBox">
		<view class="Box" v-for="item,index in noticeList" :key="index" @click="checkUser(item.who)">
			<view class="UserInfo">
				<view class="Avatar">
					<image v-bind:src="'http://cdn.gdxywsw.club/' + item.avatar" />
				</view>
				<view>
					<view class="NicknameAndDate">
						<view class="Nickname">{{ item.nickname }}</view>
						<view class="Date">{{item.date}}</view>
					</view>

					<view class="Description" v-if="item.classification == '点赞帖子'">{{ item.classification }}
						{{item.content}}
					</view>
					<view class="Description" v-if="item.classification == '查看'">查看了你的个人主页</view>
					<view class="Description" v-if="item.classification == '评论'">评论了你&nbsp; {{item.content}}</view>
					<view class="Description" v-if="item.classification == '点赞评论'">点赞了你的评论&nbsp; {{item.content}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "myNotice",
		data() {
			return {

			};
		},

		props: {
			noticeList: {
				type: Object,
				default: {}
			}

		},
		methods: {
			// 查看用户
			checkUser(who) {
				uni.navigateTo({
					url: '/subpkg/othersHome/othersHome?otherUid=' + encodeURIComponent(JSON.stringify(
						who))
				})

			},
		}
	}
</script>

<style lang="less">
	.noticeBox {

		.Box {
			display: flex;
			margin-left: 10px;
			margin-right: 10px;
			margin-bottom: 10px;
			padding: 5px;
			border-radius: 5px;
			background-color: #eee;
			justify-content: space-between;
			align-items: center;

			.UserInfo {
				display: flex;

				.Avatar image {
					width: 40px;
					height: 40px;
					border-radius: 40px;
					border: 1px solid #e1e4e6;
				}

				.NicknameAndDate {
					display: flex;

					.Date {
						margin: 5px 0 0 10px;
						font-size: 10px;
						color: grey;
					}

					.Nickname {
						margin-top: 2px;
						margin-left: 5px;
						font-weight: bolder;
					}
				}

				.Description {
					margin-top: 3px;
					font-size: 13px;
					margin-left: 5px;
				}
			}

		}

	}
</style>
